<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        img{
            width: 200px;
        }
        div{
            width: 200px;
            height: 200px;
        }
        /*属性选择器*/
        /*img[alt='pic1']{*/
        /*    border: 2px solid red;*/
        /*}*/

        /*img[alt]{*/
        /*    border: 2px solid red;*/
        /*}*/

        [alt='pic1']{
            border: 2px solid red;
        }

        /*[alt]{*/
        /*    border: 2px solid red;*/
        /*}*/
    </style>
</head>
<body>

<!--
    属性选择器
-->

<img src="./imgs/1.jpg" alt="pic1"><br>
<img src="./imgs/2.jpeg" alt="pic2">

<div alt="pic1"></div>
</body>
</html>